﻿<UserControl xmlns:my="clr-namespace:It.Uniba.Di.Cdg.SocialTfs.Client.Objects" 
             x:Class="It.Uniba.Di.Cdg.SocialTfs.Client.Containers.UIRegistration"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">

    <UserControl.Background>
        <ImageBrush ImageSource="/It.Uniba.Di.Cdg.SocialTfs.Client;component/Images/Wallpaper.png" />
    </UserControl.Background>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
            <RowDefinition Name="HostErrorRow" Height="0" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Name="UsernameErrorRow" Height="0" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Name="ErrorRow" Height="0" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Label Grid.ColumnSpan="2" Grid.Row="0" Margin="5,10" VerticalAlignment="Bottom" FontSize="28" FontWeight="Bold" Foreground="#FF293955">Registration</Label>
        <Label Grid.Column="0" Grid.Row="1" Margin="5,2">Proxy server host</Label>
        <TextBox Name="ProxyHost" LostFocus="ProxyHost_LostFocus" TabIndex="0" Grid.Column="1" Grid.Row="1" Margin="2"></TextBox>

        <my:UILittleBusy x:Name="LoadingProxyHost" HorizontalAlignment="Right" VerticalAlignment="Center" Width="20" Height="20" Grid.Column="1" Grid.Row="1" Margin="3" Panel.ZIndex="1" Visibility="Hidden" />
        
        <Border Name="HostErrorBorder" Grid.ColumnSpan="2" Grid.Row="2" Margin="2" BorderThickness="1" BorderBrush="Black" >
            <Label Name="HostErrorLabel" HorizontalAlignment="Center" />
        </Border>

        <Label Grid.Column="0" Grid.Row="3" Margin="5,2">Email</Label>
        <TextBox Name="Email" Grid.Column="1" Grid.Row="3" Margin="2,2,2,0" Height="26" VerticalAlignment="Top" TabIndex="1"></TextBox>

        <Label Grid.Column="0" Grid.Row="4" Margin="5,2">Invitation code</Label>
        <PasswordBox Name="InvitationCode" Grid.Column="1" Grid.Row="4" Margin="2" TabIndex="2"></PasswordBox>

        <Label Grid.Column="0" Grid.Row="5" Margin="5,2">Username</Label>
        <TextBox Name="UserName" LostFocus="Username_LostFocus" Grid.Column="1" Grid.Row="5" Margin="2" TabIndex="3"></TextBox>

        <my:UILittleBusy x:Name="LoadingUserName" HorizontalAlignment="Right" VerticalAlignment="Center" Width="20" Height="20"  Grid.Column="1" Grid.Row="5" Margin="3" Panel.ZIndex="1" Visibility="Hidden" />
        
        <Border Name="UsernameErrorBorder" Grid.ColumnSpan="2" Grid.Row="6" Margin="2" BorderThickness="1" BorderBrush="Black">
            <Label Name="UsernameErrorLabel" HorizontalAlignment="Center" />
        </Border>

        <Label Grid.Column="0" Grid.Row="7" Margin="5,2">Password</Label>
        <PasswordBox Name="Password" Grid.Column="1" Grid.Row="7" Margin="2" LostFocus="Password_LostFocus" TabIndex="4"></PasswordBox>

        <Label Grid.Column="0" Grid.Row="8" Margin="5,2">Confirm password</Label>
        <PasswordBox Name="ConfirmPassword" Grid.Column="1" Grid.Row="8" Margin="2" LostFocus="Password_LostFocus" TabIndex="5"></PasswordBox>

        <Border Name="ErrorBorder" Grid.ColumnSpan="2" Grid.Row="9" Margin="2" BorderThickness="1" BorderBrush="Black">
            <Label Name="ErrorLabel" HorizontalAlignment="Center" />
        </Border>

        <my:UICustomButton Grid.ColumnSpan="2" Grid.Row="10" Click="RegisterButton_Click" Width="75" Height="25" Margin="5" HorizontalAlignment="Right"  Text="Register" StaticBorder="True" IsDefault="True" />

        <TextBlock Grid.ColumnSpan="2" Grid.Row="11" Margin="5,10" VerticalAlignment="Bottom" TextAlignment="Center">
                <Hyperlink Click="ShowLoginButton_Click">I already have an account, I want to sign in</Hyperlink>
        </TextBlock>
    </Grid>
</UserControl>
